// 闭包对内存的占用和释放

function a()
{
    var largeStr = {
        str: new Array(100000).join('x')
    }
    function b() {
        return largeStr
    }

    largeStr.b = b

    return b
}

var foo = a()
foo()

setTimeout(function() {
    foo = null;
}, 5000);

